﻿using System;
using System.Collections.Generic;
using System.Text;
using WAD.Model;
using System.Data;

namespace WAD.DAL.Union
{
    public class DAOAgentRecord : DAO_Union
    {
        public PageData GetPageList(string where, int pageIndex, int pageSize)
        {
            PageData pageData = new PageData();

            DataTable dt = DAO_Union.ExecuteDataTable(string.Format("select top {0} * from vifo_users_ja {1}", pageSize, where));
            int itemCount = dt.Rows.Count;
            int pageCount = itemCount / pageSize;


            pageData.table = dt;
            pageData.pageSize = pageSize;
            pageData.pageIndex = pageIndex;

            //总页数
            pageData.pageCount = pageCount;

            //数据总条数
            pageData.itemCount = itemCount;
            return pageData;
        }
    }
}